<template>
  <div v-if="visible" class="buy-dialog">
    <div class="buy-mask"></div>
    <div class="buy-content">
      <div class="dialog-content">
        <img class="buy-error" src="@/assets/images/pop_ups.png" alt="" />
      </div>
      <img class="dialog-close" src="@/assets/images/icon_close_1.png" @click="closeDialog" />
    </div>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue'

const visible = ref(false)
const openDialog = () => {
  visible.value = true
}
const closeDialog = () => {
  visible.value = false
}
defineExpose({
  openDialog,
  closeDialog,
})
</script>
<style scoped lang="scss">
.buy-dialog {
  position: relative;
  z-index: 9999;
}
.buy-mask {
  width: 100vw;
  height: 100vh;
  background: #343434;
  opacity: 0.64;
  position: fixed;
  left: 0;
  top: 0;
}
.buy-content {
  position: fixed;
  z-index: 999;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 224px;
  background: #fff;
  border-radius: 8px;
}
.dialog-content {
  position: relative;
  .buy-error {
    width: 100%;
    height: 100%;
  }
}
.dialog-close {
  position: absolute;
  left: 50%;
  bottom: -57px;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
}
</style>
